<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>구구단 scriptlet</title>
</head>
<body>
	<%
		//1. out.println
		//2. 출력되는thml태그 조합, 출력 결과는 항상 소스보기로 확인, 개발자 도구
		out.println("<table border='1'>");
		for (int dan = 0; dan <= 9; dan++) {
			out.println("<tr>");
			for (int j = 0; j <= 9; j++) {
				if(dan==0 && j==0){
					out.println("<td>" + "</td>");
				}else if(dan==0){
					out.println("<td>" + "*" +j+"</td>");
				}else if(j==0){
					out.println("<td>" + dan + "단" + "</td>");
				}else if(dan%2==0){ //짝수 파란
					out.println("<td bgcolor='#FF0000'>" + dan + "*" + j + "=" + (dan * j)+ "</td>");
				}else {
					out.println("<td bgcolor='#0000FF'>" + dan + "*" + j + "=" + (dan * j)+ "</td>");
				}
			}
			out.println("</tr>");
		}
		out.println("</table>");
	%>
</body>
</html>